phantom.casperPath = 'D:\\phantomjs\\casperjs\\';
phantom.injectJs(phantom.casperPath + 'bin\\bootstrap.js');
phantom.injectJs('util\\cutil.js');
phantom.injectJs("D:\\phantomjs\\js\\json.js");

var casper = require('casper').create();

var fs = require('fs');
var dir = "d:\\phantomjs\\casperjs";

casper.start();
console.log(fs.isDirectory(dir));
casper.run();